﻿<UserControl x:Class="XDCCManager.Controls.PackList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:Packs="clr-namespace:XDCCManager.Model.Packs"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
	<UserControl.Resources>
		<DataTemplate x:Key="PackInfoDataTemplate">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition SharedSizeGroup="PackColumnGets" Width="Auto"/>
					<ColumnDefinition SharedSizeGroup="PackColumnSize" Width="Auto"/>
					<ColumnDefinition SharedSizeGroup="PackColumnState" Width="Auto"/>
				</Grid.ColumnDefinitions>
				<TextBlock Text="{Binding Gets}" Margin="20,0,0,0" TextAlignment="Right"/>
				<TextBlock Text="{Binding Size}" Margin="20,0,0,0" Grid.Column="1" TextAlignment="Right"/>
				<TextBlock Margin="20,0,0,0" Grid.Column="2"/>
			</Grid>
		</DataTemplate>
		<DataTemplate DataType="{x:Type Packs:MovedPack}">
			<DockPanel>
				<Button Content="Edit" HorizontalAlignment="Left" VerticalAlignment="Top" DockPanel.Dock="Right" Click="Edit_Click"/>
				<StackPanel>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition SharedSizeGroup="PackColumnNumber" Width="Auto"/>
							<ColumnDefinition SharedSizeGroup="PackColumnDescription" Width="Auto"/>
						</Grid.ColumnDefinitions>
						<TextBlock Text="{Binding Number}"/>
						<TextBlock Text="{Binding Description}" Margin="20,0,0,0" Grid.Column="1"/>
					</Grid>
					<ContentControl Content="{Binding}" ContentTemplate="{DynamicResource PackInfoDataTemplate}"/>
				</StackPanel>
			</DockPanel>
		</DataTemplate>
		<DataTemplate DataType="{x:Type Packs:DeletedPack}">
			<DockPanel>
				<StackPanel>
					<Grid>
						<Grid.ColumnDefinitions>
							<ColumnDefinition SharedSizeGroup="PackColumnNumber" Width="Auto"/>
							<ColumnDefinition SharedSizeGroup="PackColumnDescription" Width="Auto"/>
						</Grid.ColumnDefinitions>
						<TextBlock Text="{Binding Description}" Margin="20,0,0,0" Grid.Column="1"/>
					</Grid>
					<ContentControl Content="{Binding}" ContentTemplate="{DynamicResource PackInfoDataTemplate}"/>
				</StackPanel>
			</DockPanel>
		</DataTemplate>
	</UserControl.Resources>
	<Grid DataContext="{DynamicResource ServedFilesContextDataSource}">
		<ListBox x:Name="list" HorizontalContentAlignment="Stretch" ItemsSource="{Binding ViewPacks, Mode=OneWay}" Grid.IsSharedSizeScope="True" SelectionChanged="list_SelectionChanged"/>
            
    </Grid>
</UserControl>
